//
//  YSGHomeBannerCell.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/6/19.
//  Copyright © 2020 QDSG. All rights reserved.
//

import UIKit

protocol YSGHomeBannerCellDelegate: NSObjectProtocol {
    func bannerCell(didSelectedAt index: Int)
}

class YSGHomeBannerCell: UITableViewCell {

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        makeUI()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        makeUI()
    }
    
    private func makeUI() {
        backgroundColor = .clear
        contentView.backgroundColor = .clear
    }
    
    func configure(with vm: YSGHomeViewModel, target: Any?) {
//        bannerView.delegate = target as? BannerViewDelegate
//        bannerView.viewModel = vm.centerBannerVm()
    }
    
    @IBOutlet private weak var bannerView: BannerView! {
        didSet {
            bannerView.isAutoScroll = true
            
            
            bannerView.layer.shadowColor = UIColor(red: 0.84, green: 0.88, blue: 1, alpha: 0.31).cgColor
            bannerView.layer.shadowOffset = CGSize(width: 0, height: 0)
            bannerView.layer.shadowRadius = 6
            bannerView.layer.shadowOpacity = 1
            bannerView.layer.masksToBounds = false
            bannerView.layer.cornerRadius = 6
        }
    }
}
